class GameCamera
{
 private PVector location;
 private PVector direction;
 private PVector top;
 private PVector side;
 private float yAngle = 0;
 public   float fov = PI/3;
public   float cameraZ = (height/2.0) / tan(fov/2.0); 
 

 public GameCamera()
 {
  this.location = new PVector(0,0,0);
  this.direction = new PVector(0,0,1);
  this.top = new PVector(0,1,0);
  this.side = new PVector(1,0,0);

  perspective(fov, float(width)/float(height), 
            cameraZ/1000.0, cameraZ*10.0);
 }
 
 private void apply()
 {
   perspective(fov, float(width)/float(height), 
            cameraZ/1000.0, cameraZ*10.0);
  camera(location.x, location.y, location.z, location.x+direction.x, location.y+direction.y, location.z+direction.z, 0, -1, 0); 
 }
 
 public PVector getLocation()
 {
  return location; 
 }
 
 public void setLocation(PVector _location)
 {
  this.location = _location;
 }
 
 public PVector getDirection()
 {
   return direction;
 }
 
 public void setDirection(PVector _direction)
 {
  this.direction = _direction;
 }
 
 public void shiftLocation(PVector _shift)
 {
  setLocation(PVector.add(location, _shift));
 }
 
 public void shiftLocationRelative(PVector _shift)
 {
    PVector absoluteShift = PVector.mult(direction.cross(new PVector(0, -1, 0)), _shift.x);
    absoluteShift.add(PVector.mult(direction, _shift.z));
    
    shiftLocation(absoluteShift);
 }
 
 
 public void shiftRelativeDirection(PVector _shift)
 {
   //TODO
 }
 

 
}
